import axios from 'axios';

export interface interfaceDTO {
  groupId: string;
  keyword: string;
}
export interface interfaceVo {
  rows: interfaceDTO[];
  total: number;
}

// 分页查询接口列表
export function interfacePage(params: interfaceDTO) {
  return axios.post<interfaceVo>(`/hub/interface/page`, params);
}

export interface ParameterRelationsDTO {
  flowVariableKey: string;
  functionParameter: string;
  id: string;
  parameterRemark: string;
  parameterType: string;
}

export interface EventAddDTO {
  title: string;
  path: string;
  id: string;
  methodType: string;
  dealResultWay: string;
  interceptPattern: string;
  opinions: any[];
  parameterRelations: ParameterRelationsDTO[];
}

// 详情
export function interfaceDetail(id: string) {
  return axios.get(`/hub/interface/detail/${id}`);
}
